<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('跟单', ~{::title}, ~{::content}, ~{::script})}">
<head>
    <title>工单管理-跟单</title>
</head>
<body>

<div class="content page-work-modify-track" th:fragment="content">
    <style>
        /*.layui-table tbody tr:hover{*/
        /*    background-color: transparent !important;*/
        /*}*/
    </style>
    <link rel="stylesheet" href="/static/style/work/modify/track.css">
    <form class="layui-form" lay-filter="formTrack">
        <input type="hidden" id="work-id" name="workId" th:value="${orderWork.workId}">
        <input type="hidden" id="order-id" name="orderId" th:value="${orderWork.orderId}">
        <input type="hidden" id="other-map-id" name="otherTrackMapId" th:value="${otherTrack.mapId}">
        <input type="hidden" id="other-level" name="otherTrackLevel" th:value="${otherTrack.level}">
        <div>
            <div>
                <p class="track-title">新增跟单</p>
                <div class="layui-form-item">
                    <div class="layui-row layui-col-space5">
                        <th:block th:each="trackType : ${trackTypeList}">
                            <div class="layui-col-md3">
                                <div class="track-type-item">
                                    <input type="checkbox"
                                           name="newTrack"
                                           lay-filter="trackType"
                                           lay-skin="primary"
                                           th:id="|track-type-${trackType.mapId}|"
                                           th:value="${trackType.mapId}"
                                           th:level="${trackType.level}"
                                           th:title="${trackType.mapName}">
                                    <div class="track-level" th:classappend="|level-${trackType.level}|">
                                        <span th:if="${trackType.level == 1}" th:class="|level-${trackType.level}|">一级</span>
                                        <span th:if="${trackType.level == 2}" th:class="|level-${trackType.level}|">二级</span>
                                        <span th:if="${trackType.level == 3}" th:class="|level-${trackType.level}|">三级</span>
                                    </div>
                                </div>
                            </div>
                        </th:block>
                    </div>
                </div>
                <div class="layui-form-item">
                        <textarea name="otherTrackName" class="layui-textarea" style="width: 800px;"
                                  placeholder="请填写其他跟单内容" maxlength="200"></textarea>
                    <p class="tip">其他跟单内容，跟单等级为：一级</p>
                </div>
            </div>
            <div>
                <div>
                    <p class="track-title">跟单结果</p>
                    <div class="layui-form-item">
                        <div class="zmn-auto-table">
                            <table id="trackListTable" class="layui-table" lay-filter="table-track-list"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btn-submit">确定</button>
        </div>
        <span th:if="${#lists.size(orderTrackList) == 0}"></span>
    </form>
</div>
<script type="text/html" id="input">
    <input class="layui-input track-content" type="text" data-map-id="{{ d.mapId }}" maxlength="200" placeholder="请输入，200字内">
</script>

<script type="text/html" id="tmpl-trackListTableCheckbox">
    <a class="layui-btn"
        lay-event="delete"
        lay-filter="delete"
        data-track-id="{{ d.trackId }}"
        data-id="{{ d.mapId }}"
        data-name="{{ d.mapName }}"
        data-level="{{ d.level }}"
    >
        删除
    </a>
</script>

<script th:inline="javascript">
    var trackList = [[${orderTrackList}]];
    var layuiModel = {
        oms_work_modify_track: "work/modify/zmn.oms.work.modify.track"
    };
</script>
</body>
</html>